using System.Windows.Forms;

using ClientTools.Library.Interfaces;

namespace ClientTools.Client.Controls
{
    public class BaseUserControl: UserControl 
    {
        public Library.Settings.Profile ActProfile { get; set; }
        public object ActProvider { get; set; }

        //private Library.Settings.Profile _actProfile;
        //private object _actProvider;

        //protected internal Library.Settings.Profile ActProfile
        //{
        //    get { return _actProfile; }
        //    set { _actProfile = value; }
        //}

        //protected internal object ActProvider
        //{
        //    get { return _actProvider; }
        //    set { _actProvider = value; }
        //}

        protected bool ImplementsLogging() 
        { 
            return (ActProvider.GetType().GetInterface(typeof(ILogging).Name) != null);
        }

        protected bool ImplementsStats()
        {
            return (ActProvider.GetType().GetInterface(typeof(IStats).Name) != null);
        }

        protected bool ImplementsVersions()
        {
            return (ActProvider.GetType().GetInterface(typeof(IVersions).Name) != null);
        }

        protected bool ImplementsPackager()
        {
            return (ActProvider.GetType().GetInterface(typeof(IPackager).Name) != null);
        }

        protected bool ImplementsMedia()
        {
            return (ActProvider.GetType().GetInterface(typeof(IMedia).Name) != null);
        }

        protected bool ImplementsNodes()
        {
            return (ActProvider.GetType().GetInterface(typeof(INodes).Name) != null);
        }

    }
}
